<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <style>
        .btnBox button{
            margin-left: 0!important;
        }
        .btnBox_btn{
            margin: 5px;
        }
    </style>
    <script src="js/api.js"></script>
</head>
<body>
<div id="app">
    <h3>审核列表</h3>
    <template>
        <el-table
                :data="tableData"
                border
                style="width: 28.4%"
                :header-cell-style="{background:'#eef1f6',color:'#606266'}"
        >
            <el-table-column prop="date" label="id" width="180" align="center">
                <template slot-scope="scope">
                    {{scope.row.f_id }}
                </template>
            </el-table-column>
            <el-table-column prop="name" label="名称" width="180" align="center">
                <template slot-scope="scope">
                    {{scope.row.f_name}}
                </template>
            </el-table-column>
            <el-table-column prop="name" label="留言/操作" width="180" align="center">
                <template slot-scope="scope">
                    <div @click="msg(scope.row)">
                        <img src="image/date.png" height="17" width="17"/>
                    </div>
                </template>
            </el-table-column>
        </el-table>
    </template>

</div>
</body>
<script>
    new Vue({
        el: '#app',
        data: {
            disabled: false,
            tableData: [],
            sid: '',
            id: '',
            flowid: ''
        },
        created() {
            this.getCookie()
            if (localStorage.getItem("uid")) {
                this.list(localStorage.getItem("uid"))
            }
        },
        methods: {
            getCookie() {
                if (document.cookie.length > 0) {
                    var arr = document.cookie.split('; ')
                    for (var i = 0; i < arr.length; i++) {
                        var arr2 = arr[i].split('=')
                        if (arr2[0] === 'id') {
                            this.id = arr2[1]
                        }
                    }
                }
            },
            // 点击留言
            msg(a) {
                location.href = 'detail.html?id='+ a.id
            },
            // 点击用户
            clickBtn(a) {
                axios({
                    methods: 'post',
                    url: Api + 'sp/back',
                    params: {
                        sid: this.sid,
                        flowid: this.flowid,
                        node: a.node
                    }
                }).then(res=>{
                    if (res.status == '200') {
                        this.$message({
                            type: 'success',
                            message: res.data.data
                        })
                        this.dialogVisible = false
                    } else {
                        this.$message({
                            type: 'error',
                            message: res.data.data
                        })
                    }
                })
            },
            //  查询列表
            list(a) {
                var that = this
                axios({
                    methods: 'post',
                    url: Api + 'sp/isMyflow',
                    params:{
                        nodeUid: a
                    }
                }).then(res=>{
                    that.tableData = res.data.schedules
                })
            }
        }
    })
</script>
</html>